package com.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the orderinfo database table.
 * 
 */
@Entity
@NamedQuery(name="Orderinfo.findAll", query="SELECT o FROM Orderinfo o")
public class Orderinfo implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="o_id")
	private Integer oId;

	@Temporal(TemporalType.TIMESTAMP)
	private Date jdate;

	@Column(name="o_address")
	private String oAddress;

	@Column(name="o_consignee")
	private String oConsignee;
	@Column(name="o_conphone")
	private String oConphone;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="o_data")
	private Date oData;

	@Column(name="o_dstatus")
	private Integer oDstatus;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="o_fadate")
	private Date oFadate;

	@Column(name="o_pay")
	private Integer oPay;

	@Column(name="o_phone")
	private String oPhone;

	@Column(name="o_postcode")
	private String oPostcode;

	@Column(name="o_remark")
	private String oRemark;

	@Column(name="o_salesreturn")
	private Integer oSalesreturn;

	@Column(name="o_shipments")
	private Integer oShipments;

	@Column(name="o_sign")
	private Integer oSign;

	@Column(name="o_status")
	private Integer oStatus;

	@Column(name="o_summoney")
	private BigDecimal oSummoney;
	
	@Column(name="oreturned")
	private BigDecimal oreturned;

	@Column(name="o_title")
	private String oTitle;

	@Column(name="o_type")
	private Integer oType;

	@Column(name="u_id")
	private Integer uId;

	//bi-directional many-to-one association to Backmoneyplan
	@JsonIgnore
	@OneToMany(mappedBy="orderinfo")
	private List<Backmoneyplan> backmoneyplans;

	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="cust_id")
	private Customer customer;

	//bi-directional many-to-one association to SalesOpportunity
	@ManyToOne
	@JoinColumn(name="salt_id")
	private SalesOpportunity salesOpportunity;

	//bi-directional many-to-one association to Orderitem
	@JsonIgnore
	@OneToMany(mappedBy="orderinfo")
	private List<Orderitem> orderitems;

	//bi-directional many-to-one association to Outgood
	@JsonIgnore
	@OneToMany(mappedBy="orderinfo")
	private List<Outgood> outgoods;

	//bi-directional many-to-one association to Refundgood
	@JsonIgnore
	@OneToMany(mappedBy="orderinfo")
	private List<Refundgood> refundgoods;

	//bi-directional many-to-one association to Refundrecord
	@JsonIgnore
	@OneToMany(mappedBy="orderinfo")
	private List<Refundrecord> refundrecords;

	//bi-directional many-to-one association to Returnmoney
	@JsonIgnore
	@OneToMany(mappedBy="orderinfo")
	private List<Returnmoney> returnmoneys;

	public Orderinfo() {
	}

	
	
	@Override
	public String toString() {
		return "Orderinfo [oId=" + oId + ", jdate=" + jdate + ", oAddress=" + oAddress + ", oConsignee=" + oConsignee
				+ ", oConphone=" + oConphone + ", oData=" + oData + ", oDstatus=" + oDstatus + ", oFadate=" + oFadate
				+ ", oPay=" + oPay + ", oPhone=" + oPhone + ", oPostcode=" + oPostcode + ", oRemark=" + oRemark
				+ ", oSalesreturn=" + oSalesreturn + ", oShipments=" + oShipments + ", oSign=" + oSign + ", oStatus="
				+ oStatus + ", oSummoney=" + oSummoney + ", oTitle=" + oTitle + ", oType=" + oType + ", uId=" + uId
				+ ", backmoneyplans=" + backmoneyplans + ", customer=" + customer + ", salesOpportunity="
				+ salesOpportunity + ", orderitems=" + orderitems + "]";
	}



	public BigDecimal getOreturned() {
		return oreturned;
	}



	public void setOreturned(BigDecimal oreturned) {
		this.oreturned = oreturned;
	}



	public String getoConphone() {
		return oConphone;
	}

	public void setoConphone(String oConphone) {
		this.oConphone = oConphone;
	}

	public Integer getOId() {
		return this.oId;
	}

	public void setOId(Integer oId) {
		this.oId = oId;
	}

	public Date getJdate() {
		return this.jdate;
	}

	public void setJdate(Date jdate) {
		this.jdate = jdate;
	}

	public String getOAddress() {
		return this.oAddress;
	}

	public void setOAddress(String oAddress) {
		this.oAddress = oAddress;
	}

	public String getOConsignee() {
		return this.oConsignee;
	}

	public void setOConsignee(String oConsignee) {
		this.oConsignee = oConsignee;
	}

	public Date getOData() {
		return this.oData;
	}

	public void setOData(Date oData) {
		this.oData = oData;
	}

	public Integer getODstatus() {
		return this.oDstatus;
	}

	public void setODstatus(Integer oDstatus) {
		this.oDstatus = oDstatus;
	}

	public Date getOFadate() {
		return this.oFadate;
	}

	public void setOFadate(Date oFadate) {
		this.oFadate = oFadate;
	}

	public Integer getOPay() {
		return this.oPay;
	}

	public void setOPay(Integer oPay) {
		this.oPay = oPay;
	}

	public String getOPhone() {
		return this.oPhone;
	}

	public void setOPhone(String oPhone) {
		this.oPhone = oPhone;
	}

	public String getOPostcode() {
		return this.oPostcode;
	}

	public void setOPostcode(String oPostcode) {
		this.oPostcode = oPostcode;
	}

	public String getORemark() {
		return this.oRemark;
	}

	public void setORemark(String oRemark) {
		this.oRemark = oRemark;
	}

	public Integer getOSalesreturn() {
		return this.oSalesreturn;
	}

	public void setOSalesreturn(Integer oSalesreturn) {
		this.oSalesreturn = oSalesreturn;
	}

	public Integer getOShipments() {
		return this.oShipments;
	}

	public void setOShipments(Integer oShipments) {
		this.oShipments = oShipments;
	}

	public Integer getOSign() {
		return this.oSign;
	}

	public void setOSign(Integer oSign) {
		this.oSign = oSign;
	}

	public Integer getOStatus() {
		return this.oStatus;
	}

	public void setOStatus(Integer oStatus) {
		this.oStatus = oStatus;
	}

	public BigDecimal getOSummoney() {
		return this.oSummoney;
	}

	public void setOSummoney(BigDecimal oSummoney) {
		this.oSummoney = oSummoney;
	}

	public String getOTitle() {
		return this.oTitle;
	}

	public void setOTitle(String oTitle) {
		this.oTitle = oTitle;
	}

	public Integer getOType() {
		return this.oType;
	}

	public void setOType(Integer oType) {
		this.oType = oType;
	}

	public Integer getUId() {
		return this.uId;
	}

	public void setUId(Integer uId) {
		this.uId = uId;
	}

	public List<Backmoneyplan> getBackmoneyplans() {
		return this.backmoneyplans;
	}

	public void setBackmoneyplans(List<Backmoneyplan> backmoneyplans) {
		this.backmoneyplans = backmoneyplans;
	}

	public Backmoneyplan addBackmoneyplan(Backmoneyplan backmoneyplan) {
		getBackmoneyplans().add(backmoneyplan);
		backmoneyplan.setOrderinfo(this);

		return backmoneyplan;
	}

	public Backmoneyplan removeBackmoneyplan(Backmoneyplan backmoneyplan) {
		getBackmoneyplans().remove(backmoneyplan);
		backmoneyplan.setOrderinfo(null);

		return backmoneyplan;
	}

	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public SalesOpportunity getSalesOpportunity() {
		return this.salesOpportunity;
	}

	public void setSalesOpportunity(SalesOpportunity salesOpportunity) {
		this.salesOpportunity = salesOpportunity;
	}

	public List<Orderitem> getOrderitems() {
		return this.orderitems;
	}

	public void setOrderitems(List<Orderitem> orderitems) {
		this.orderitems = orderitems;
	}

	public Orderitem addOrderitem(Orderitem orderitem) {
		getOrderitems().add(orderitem);
		orderitem.setOrderinfo(this);

		return orderitem;
	}

	public Orderitem removeOrderitem(Orderitem orderitem) {
		getOrderitems().remove(orderitem);
		orderitem.setOrderinfo(null);

		return orderitem;
	}

	public List<Outgood> getOutgoods() {
		return this.outgoods;
	}

	public void setOutgoods(List<Outgood> outgoods) {
		this.outgoods = outgoods;
	}

	public Outgood addOutgood(Outgood outgood) {
		getOutgoods().add(outgood);
		outgood.setOrderinfo(this);

		return outgood;
	}

	public Outgood removeOutgood(Outgood outgood) {
		getOutgoods().remove(outgood);
		outgood.setOrderinfo(null);

		return outgood;
	}

	public List<Refundgood> getRefundgoods() {
		return this.refundgoods;
	}

	public void setRefundgoods(List<Refundgood> refundgoods) {
		this.refundgoods = refundgoods;
	}

	public Refundgood addRefundgood(Refundgood refundgood) {
		getRefundgoods().add(refundgood);
		refundgood.setOrderinfo(this);

		return refundgood;
	}

	public Refundgood removeRefundgood(Refundgood refundgood) {
		getRefundgoods().remove(refundgood);
		refundgood.setOrderinfo(null);

		return refundgood;
	}

	public List<Refundrecord> getRefundrecords() {
		return this.refundrecords;
	}

	public void setRefundrecords(List<Refundrecord> refundrecords) {
		this.refundrecords = refundrecords;
	}

	public Refundrecord addRefundrecord(Refundrecord refundrecord) {
		getRefundrecords().add(refundrecord);
		refundrecord.setOrderinfo(this);

		return refundrecord;
	}

	public Refundrecord removeRefundrecord(Refundrecord refundrecord) {
		getRefundrecords().remove(refundrecord);
		refundrecord.setOrderinfo(null);

		return refundrecord;
	}

	public List<Returnmoney> getReturnmoneys() {
		return this.returnmoneys;
	}

	public void setReturnmoneys(List<Returnmoney> returnmoneys) {
		this.returnmoneys = returnmoneys;
	}

	public Returnmoney addReturnmoney(Returnmoney returnmoney) {
		getReturnmoneys().add(returnmoney);
		returnmoney.setOrderinfo(this);

		return returnmoney;
	}

	public Returnmoney removeReturnmoney(Returnmoney returnmoney) {
		getReturnmoneys().remove(returnmoney);
		returnmoney.setOrderinfo(null);

		return returnmoney;
	}
	
	

}